package com.biwow.ai.helloworld.controller;

import com.biwow.ai.helloworld.service.QdrantService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/vectors")
public class QdrantController {
    private final QdrantService qdrantService;

    public QdrantController(QdrantService qdrantService) {
        this.qdrantService = qdrantService;
    }

    @PostMapping("/{collection}")
    public ResponseEntity<String> createCollection(
            @PathVariable String collection,
            @RequestParam int dimension) {

        qdrantService.createCollection(collection, dimension);
        return ResponseEntity.ok("Collection created");
    }
}
